package org.omg.TimeBase;

/**
 * Generated from IDL definition of struct "ulonglong"
 * 
 * @author orbas IDL compiler
 */

public final class ulonglongHelper {
	private static org.omg.CORBA.TypeCode _type = null;

	public static org.omg.CORBA.TypeCode type() {
		if (_type == null) {
			_type = org.omg.CORBA.ORB.init().create_struct_tc(
					org.omg.TimeBase.ulonglongHelper.id(),
					"ulonglong",
					new org.omg.CORBA.StructMember[] {
							new org.omg.CORBA.StructMember("low",
									org.omg.CORBA.ORB.init().get_primitive_tc(
											org.omg.CORBA.TCKind.from_int(5)),
									null),
							new org.omg.CORBA.StructMember("high",
									org.omg.CORBA.ORB.init().get_primitive_tc(
											org.omg.CORBA.TCKind.from_int(5)),
									null) });
		}
		return _type;
	}

	public static void insert(final org.omg.CORBA.Any any,
			final org.omg.TimeBase.ulonglong s) {
		org.omg.CORBA.portable.OutputStream out = any.create_output_stream();
		any.type(type());
		write(out, s);
		any.read_value(out.create_input_stream(), type());
	}

	public static org.omg.TimeBase.ulonglong extract(final org.omg.CORBA.Any any) {
		return read(any.create_input_stream());
	}

	public static String id() {
		return "IDL:org/omg/TimeBase/ulonglong:1.0";
	}

	public static org.omg.TimeBase.ulonglong read(
			final org.omg.CORBA.portable.InputStream in) {
		org.omg.TimeBase.ulonglong result = new org.omg.TimeBase.ulonglong();
		result.low = in.read_ulong();
		result.high = in.read_ulong();
		return result;
	}

	public static void write(final org.omg.CORBA.portable.OutputStream out,
			final org.omg.TimeBase.ulonglong s) {
		out.write_ulong(s.low);
		out.write_ulong(s.high);
	}
}
